home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10633 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: 8 Mar 1996 13:19:02 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4hq886INN37o@keats.ugrad.cs.ubc.ca>
  8. References: <00001a73+00002504@msn.com> <313EE686.25CD@lfwc.lockheed.com> <4hnimb$elm@solutions.solon.com> <314021BA.3C57@lfwc.lockheed.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <314021BA.3C57@lfwc.lockheed.com>,
  12. Ken Garlington  <GarlingtonKE@lfwc.lockheed.com> wrote:
  13.  >Peter Seebach wrote:
  14.  >> Ken Garlington  <GarlingtonKE@lfwc.lockheed.com> wrote:
  15.  >> >Kazimir Kylheku wrote:
  16.  >> >> The only thing that bitfields are good for, portably, is optimizing the
  17.  >> >> storage of small signed or unsigned integers or flag sets, at some
  18.  >> >> computational expense.
  19.  >> 
  20.  >> >Or, for example, implementing standard communications protocols used frequently
  21.  >> >in embedded systems, such as MIL-STD-1553.
  22.  >> 
  23.  >> But then that's not "portable" - he did say "portably".  Most things like that
  24.  >> can't be done portably anyway, so are not at issue.
  25.  >
  26.  >It can be _extremely_ portable -- between different compilers, between different
  27.  >CPUs, and between different systems. Can you find a case where it won't port?
  28.  >Probably. Nonetheless, it will port quite well in a lot of cases. And since it's
  29.  >a _standard_ protocol, it's worth writing in a portable manner. I don't know
  30.  >whether the C equivalent is portable or not, but I do know that the Ada approach
  31.  >to bitfields can port quite well. Part of that portability, of course, comes from
  32.  >the abilities of the language.
  33.  
  34. The confusion here stems from a misunderstanding. Peter might be thinking that
  35. the bitfields are actually made part of protocol messages without external
  36. representation. What you probably mean is that the implementations of this
  37. protocol uses bitfield construct in the local representation which are
  38. encapsulated into an externa form, or perhaps they are only used locally in the
  39. representation of important data structures.
  40. -- 
  41.  
  42.